package com.mud.dnd.domain.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnore;

@Entity
public class Deck extends GameItem implements Serializable {
	

	
	private List<Card> cards;
	private List<Integer> cardIDs;
	
	
	private static final long serialVersionUID = 1L;
	
	
	
	
	
	
	public Deck() {
		super();
	}


	public Deck(String name, String description, String pictureURL, User author) {
		super();
		this.name = name;
		this.description = description;
		this.pictureURL = pictureURL;
		this.author = author;
	}


	
	@JsonIgnore
	@ManyToMany
	@JoinTable(name="DECK_CARD")
	public List<Card> getCards() {
		return cards;
	}
	public void setCards(List<Card> cards) {
		this.cards = cards;
	}

	@Transient
	public List<Integer> getCardIDs() {
		return cardIDs;
	}


	public void setCardIDs(List<Integer> cardIDs) {
		this.cardIDs = cardIDs;
	}

	
	
}
